/* HTML5-Canvas-Presentation (create presentations with a clear structure) */
/*  Copyright (C) 2012  Michael Fürst */
/*  */
/*  This program is free software; you can redistribute it and/or modify it */
/*  under the terms of the GNU General Public License as published by the */
/*  Free Software Foundation; either version 3 of the License, or (at your */
/*  option) any later version. */
/*  */
/*  This program is distributed in the hope that it will be useful, but */
/*  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY */
/*  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License */
/*  for more details. */
/*  */
/*  You should have received a copy of the GNU General Public License along */
/*  with this program; if not, see <http:/* www.gnu.org/licenses/>. */


var xmlDoc=document.implementation.createDocument("","",null);
var data_width = 1024;
var data_height = 768;

var text = [];
var box = [];
var circle = [];
var line =  [];
var path = [];
var textE = [];
var boxE = [];
var circleE = [];
var lineE =  [];
var pathE = [];
var textAE = [];
var boxAE = [];
var circleAE = [];
var lineAE =  [];
var textA = [];
var boxA = [];
var circleA = [];
var lineA =  [];
/* TODO add video, img */
var background = null;

function data_background(step, percent) {
	if (background != null) {
		Presentation.background(background);
	}
}

function data_init() {
	xmlDoc.onload=xml_callback;
	xmlDoc.load("data.xml");
}

function data_render() {
	Presentation.colorRGB(255,255,255);
	/* TODO add video, img */

	/* normal */
	for (var i = 0; i < text.length; i++) {
		Presentation.text(text[i].x, text[i].y, text[i].str, text[i].size, text[i].angle);
	}
	for (var i = 0; i < box.length; i++) {
		Presentation.box(box[i].x, box[i].y, box[i].width, box[i].height, box[i].b_round, box[i].angle);
	}
	for (var i = 0; i < circle.length; i++) {
		Presentation.circle(circle[i].x, circle[i].y, circle[i].radius);
	}
	for (var i = 0; i < line.length; i++) {
		Presentation.line(line[i].x, line[i].y, line[i].x2, line[i].y2);
	}
	/* extended */
	for (var i = 0; i < textE.length; i++) {
		Presentation.textE(textE[i].x, textE[i].y, textE[i].str, textE[i].size, textE[i].angle, textE[i].begin, textE[i].end);
	}
	for (var i = 0; i < boxE.length; i++) {
		Presentation.boxE(boxE[i].x, boxE[i].y, boxE[i].width, boxE[i].height, boxE[i].b_round, boxE[i].angle, boxE[i].begin, boxE[i].end);
	}
	for (var i = 0; i < circleE.length; i++) {
		Presentation.circleE(circleE[i].x, circleE[i].y, circleE[i].radius, circleE[i].begin, circleE[i].end);
	}
	for (var i = 0; i < lineE.length; i++) {
		Presentation.lineE(lineE[i].x, lineE[i].y, lineE[i].x2, lineE[i].y2, lineE[i].begin, lineE[i].end);
	}
	/* animated */
	for (var i = 0; i < textA.length; i++) {
		Presentation.textA(textA[i].x, textA[i].y, textA[i].x2, textA[i].y2, textA[i].str, textA[i].size, textA[i].size2, textA[i].angle, textA[i].angle2);
	}
	for (var i = 0; i < boxA.length; i++) {
		Presentation.boxA(boxA[i].x, boxA[i].y, boxA[i].x2, boxA[i].y2, boxA[i].width, boxA[i].height, boxA[i].width2, boxA[i].height2, boxA[i].b_round, boxA[i].angle, boxA[i].angle2);
	}
	for (var i = 0; i < circleA.length; i++) {
		Presentation.circleA(circleA[i].x, circleA[i].y, circleA[i].x2, circleA[i].y2, circleA[i].radius, circleA[i].radius2);
	}
	for (var i = 0; i < lineA.length; i++) {
		Presentation.lineA(lineA[i].x, lineA[i].y, lineA[i].x3, lineA[i].y3, lineA[i].x2, lineA[i].y2, lineA[i].x4, lineA[i].y4);
	}
	/* animated, extended */
	for (var i = 0; i < textAE.length; i++) {
		Presentation.textAE(textAE[i].x, textAE[i].y, textAE[i].x2, textAE[i].y2, textAE[i].str, textAE[i].size,  textAE[i].size2, textAE[i].angle,  textAE[i].angle2, textAE[i].begin, textAE[i].end);
	}
	for (var i = 0; i < boxAE.length; i++) {
		Presentation.boxAE(boxAE[i].x, boxAE[i].y, boxAE[i].x2, boxAE[i].y2, boxAE[i].width, boxAE[i].height, boxAE[i].width2, boxAE[i].height2, boxAE[i].b_round, boxAE[i].angle, box[i].angle2, boxAE[i].begin, boxAE[i].end);
	}
	for (var i = 0; i < circleAE.length; i++) {
		Presentation.circleAE(circleAE[i].x, circleAE[i].y, circleAE[i].x2, circleAE[i].y2, circleAE[i].radius, circleAE[i].radius2, circleAE[i].begin, circleAE[i].end);
	}
	for (var i = 0; i < lineAE.length; i++) {
		Presentation.lineAE(lineAE[i].x, lineAE[i].y, lineAE[i].x3, lineAE[i].y3, lineAE[i].x2, lineAE[i].y2, lineAE[i].x4, lineAE[i].y4, lineAE[i].begin, lineAE[i].end);
	}
}

function xml_callback () {

	/* text */
	var temp = xmlDoc.getElementsByTagName("text");
	for (var i = 0; i < temp.length; i++) {
		text[i] = {x:0,y:0,str:"",size:0,angle:0};
		text[i].x = parseInt(temp.item(i).getElementsByTagName("x")[0].firstChild.textContent);
		text[i].y = parseInt(temp.item(i).getElementsByTagName("y")[0].firstChild.textContent);
		text[i].str = temp.item(i).getElementsByTagName("str")[0].firstChild.textContent;
		text[i].size = parseInt(temp.item(i).getElementsByTagName("size")[0].firstChild.textContent);
		text[i].angle = parseInt(temp.item(i).getElementsByTagName("angle")[0].firstChild.textContent);
	}
	temp = xmlDoc.getElementsByTagName("textE");
	for (var i = 0; i < temp.length; i++) {
		textE[i] = {x:0,y:0,str:"",size:0,angle:0,begin:0,end:0};
		textE[i].x = parseInt(temp.item(i).getElementsByTagName("x")[0].firstChild.textContent);
		textE[i].y = parseInt(temp.item(i).getElementsByTagName("y")[0].firstChild.textContent);
		textE[i].str = temp.item(i).getElementsByTagName("str")[0].firstChild.textContent;
		textE[i].size = parseInt(temp.item(i).getElementsByTagName("size")[0].firstChild.textContent);
		textE[i].angle = parseInt(temp.item(i).getElementsByTagName("angle")[0].firstChild.textContent);
		textE[i].begin = parseInt(temp.item(i).getElementsByTagName("begin")[0].firstChild.textContent);
		textE[i].end = parseInt(temp.item(i).getElementsByTagName("end")[0].firstChild.textContent);
	}
	temp = xmlDoc.getElementsByTagName("textA");
	for (var i = 0; i < temp.length; i++) {
		textA[i] = {x:0,y:0,x2:0,y2:0,str:"",size:0,size2:0,angle:0,angle2:0, begin:0,end:0};
		textA[i].x = parseInt(temp.item(i).getElementsByTagName("x")[0].firstChild.textContent);
		textA[i].y = parseInt(temp.item(i).getElementsByTagName("y")[0].firstChild.textContent);
		textA[i].x2 = parseInt(temp.item(i).getElementsByTagName("x2")[0].firstChild.textContent)
		textA[i].y2 = parseInt(temp.item(i).getElementsByTagName("y2")[0].firstChild.textContent);
		textA[i].str = temp.item(i).getElementsByTagName("str")[0].firstChild.textContent;
		textA[i].size = parseInt(temp.item(i).getElementsByTagName("size")[0].firstChild.textContent);
		textA[i].size2 = parseInt(temp.item(i).getElementsByTagName("size2")[0].firstChild.textContent);
		textA[i].angle = parseInt(temp.item(i).getElementsByTagName("angle")[0].firstChild.textContent);
		textA[i].angle2 = parseInt(temp.item(i).getElementsByTagName("angle2")[0].firstChild.textContent);
		textA[i].begin = parseInt(temp.item(i).getElementsByTagName("begin")[0].firstChild.textContent);
		textA[i].end = parseInt(temp.item(i).getElementsByTagName("end")[0].firstChild.textContent);
	}
	temp = xmlDoc.getElementsByTagName("textAE");
	for (var i = 0; i < temp.length; i++) {
		textAE[i] = {x:0,y:0,x2:0,y2:0,str:"",size:0,size2:0,angle:0,angle2:0, begin:0,end:0};
		textAE[i].x = parseInt(temp.item(i).getElementsByTagName("x")[0].firstChild.textContent);
		textAE[i].y = parseInt(temp.item(i).getElementsByTagName("y")[0].firstChild.textContent);
		textAE[i].x2 = parseInt(temp.item(i).getElementsByTagName("x2")[0].firstChild.textContent);
		textAE[i].y2 = parseInt(temp.item(i).getElementsByTagName("y2")[0].firstChild.textContent);
		textAE[i].str = temp.item(i).getElementsByTagName("str")[0].firstChild.textContent;
		textAE[i].size = parseInt(temp.item(i).getElementsByTagName("size")[0].firstChild.textContent);
		textAE[i].size2 = parseInt(temp.item(i).getElementsByTagName("size2")[0].firstChild.textContent);
		textAE[i].angle = parseInt(temp.item(i).getElementsByTagName("angle")[0].firstChild.textContent);
		textAE[i].angle2 = parseInt(temp.item(i).getElementsByTagName("angle2")[0].firstChild.textContent);
		textAE[i].begin = parseInt(temp.item(i).getElementsByTagName("begin")[0].firstChild.textContent);
		textAE[i].end = parseInt(temp.item(i).getElementsByTagName("end")[0].firstChild.textContent);
	}

	/* box */
	temp = xmlDoc.getElementsByTagName("box");
	for (var i = 0; i < temp.length; i++) {
		box[i] = {x:0,y:0,width:0,height:0,b_round:false,angle:0};
		box[i].x = parseInt(temp.item(i).getElementsByTagName("x")[0].firstChild.textContent);
		box[i].y = parseInt(temp.item(i).getElementsByTagName("y")[0].firstChild.textContent);
		box[i].width = parseInt(temp.item(i).getElementsByTagName("width")[0].firstChild.textContent);
		box[i].height = parseInt(temp.item(i).getElementsByTagName("height")[0].firstChild.textContent);
		box[i].angle = parseInt(temp.item(i).getElementsByTagName("angle")[0].firstChild.textContent);
	}
	temp = xmlDoc.getElementsByTagName("boxE");
	for (var i = 0; i < temp.length; i++) {
		boxE[i] = {x:0,y:0,width:0,height:0,angle:0, begin:0,end:0};
		boxE[i].x = parseInt(temp.item(i).getElementsByTagName("x")[0].firstChild.textContent);
		boxE[i].y = parseInt(temp.item(i).getElementsByTagName("y")[0].firstChild.textContent);
		boxE[i].width = parseInt(temp.item(i).getElementsByTagName("width")[0].firstChild.textContent);
		boxE[i].height = parseInt(temp.item(i).getElementsByTagName("height")[0].firstChild.textContent);
		boxE[i].angle = parseInt(temp.item(i).getElementsByTagName("angle")[0].firstChild.textContent);
		boxE[i].begin = parseInt(temp.item(i).getElementsByTagName("begin")[0].firstChild.textContent);
		boxE[i].end = parseInt(temp.item(i).getElementsByTagName("end")[0].firstChild.textContent);
	}
	temp = xmlDoc.getElementsByTagName("boxA");
	for (var i = 0; i < temp.length; i++) {
		boxA[i] = {x:0,y:0,x2:0,y2:0,width:0,width2:0,height:0,height2:0,angle:0,angle2:0, begin:0,end:0};
		boxA[i].x = parseInt(temp.item(i).getElementsByTagName("x")[0].firstChild.textContent);
		boxA[i].y = parseInt(temp.item(i).getElementsByTagName("y")[0].firstChild.textContent);
		boxA[i].x2 = parseInt(temp.item(i).getElementsByTagName("x2")[0].firstChild.textContent);
		boxA[i].y2 = parseInt(temp.item(i).getElementsByTagName("y2")[0].firstChild.textContent);
		boxA[i].width = parseInt(temp.item(i).getElementsByTagName("width")[0].firstChild.textContent);
		boxA[i].width2 = parseInt(temp.item(i).getElementsByTagName("width2")[0].firstChild.textContent);
		boxA[i].height = parseInt(temp.item(i).getElementsByTagName("height")[0].firstChild.textContent);
		boxA[i].height2 = parseInt(temp.item(i).getElementsByTagName("height2")[0].firstChild.textContent);
		boxA[i].angle = parseInt(temp.item(i).getElementsByTagName("angle")[0].firstChild.textContent);
		boxA[i].angle2 = parseInt(temp.item(i).getElementsByTagName("angle2")[0].firstChild.textContent);
		boxA[i].begin = parseInt(temp.item(i).getElementsByTagName("begin")[0].firstChild.textContent);
		boxA[i].end = parseInt(temp.item(i).getElementsByTagName("end")[0].firstChild.textContent);
	}
	temp = xmlDoc.getElementsByTagName("boxAE");
	for (var i = 0; i < temp.length; i++) {
		boxAE[i] = {x:0,y:0,x2:0,y2:0,width:0,width2:0,height:0,height2:0,angle:0,angle2:0, begin:0,end:0};
		boxAE[i].x = parseInt(temp.item(i).getElementsByTagName("x")[0].firstChild.textContent);
		boxAE[i].y = parseInt(temp.item(i).getElementsByTagName("y")[0].firstChild.textContent);
		boxAE[i].x2 = parseInt(temp.item(i).getElementsByTagName("x2")[0].firstChild.textContent);
		boxAE[i].y2 = parseInt(temp.item(i).getElementsByTagName("y2")[0].firstChild.textContent);
		boxAE[i].width = parseInt(temp.item(i).getElementsByTagName("width")[0].firstChild.textContent);
		boxAE[i].width2 = parseInt(temp.item(i).getElementsByTagName("width2")[0].firstChild.textContent);
		boxAE[i].height = parseInt(temp.item(i).getElementsByTagName("height")[0].firstChild.textContent);
		boxAE[i].height2 = parseInt(temp.item(i).getElementsByTagName("height2")[0].firstChild.textContent);
		boxAE[i].angle = parseInt(temp.item(i).getElementsByTagName("angle")[0].firstChild.textContent);
		boxAE[i].angle2 = parseInt(temp.item(i).getElementsByTagName("angle2")[0].firstChild.textContent);
		boxAE[i].begin = parseInt(temp.item(i).getElementsByTagName("begin")[0].firstChild.textContent);
		boxAE[i].end = parseInt(temp.item(i).getElementsByTagName("end")[0].firstChild.textContent);
	}

	/* circle */
	temp = xmlDoc.getElementsByTagName("circle");
	for (var i = 0; i < temp.length; i++) {
		circle[i] = {x:0,y:0,radius:0};
		circle[i].x = parseInt(temp.item(i).getElementsByTagName("x")[0].firstChild.textContent);
		circle[i].y = parseInt(temp.item(i).getElementsByTagName("y")[0].firstChild.textContent);
		circle[i].radius = parseInt(temp.item(i).getElementsByTagName("radius")[0].firstChild.textContent);
	}
	temp = xmlDoc.getElementsByTagName("circleE");
	for (var i = 0; i < temp.length; i++) {
		circleE[i] = {x:0,y:0,radius:0,begin:0,end:0};
		circleE[i].x = parseInt(temp.item(i).getElementsByTagName("x")[0].firstChild.textContent);
		circleE[i].y = parseInt(temp.item(i).getElementsByTagName("y")[0].firstChild.textContent);
		circleE[i].radius = parseInt(temp.item(i).getElementsByTagName("radius")[0].firstChild.textContent);
		circleE[i].begin = parseInt(temp.item(i).getElementsByTagName("begin")[0].firstChild.textContent);
		circleE[i].end = parseInt(temp.item(i).getElementsByTagName("end")[0].firstChild.textContent);
	}
	temp = xmlDoc.getElementsByTagName("circleA");
	for (var i = 0; i < temp.length; i++) {
		circleA[i] = {x:0,y:0,x2:0,y2:0,radius:0,radius2:0,begin:0,end:0};
		circleA[i].x = parseInt(temp.item(i).getElementsByTagName("x")[0].firstChild.textContent);
		circleA[i].y = parseInt(temp.item(i).getElementsByTagName("y")[0].firstChild.textContent);
		circleA[i].x2 = parseInt(temp.item(i).getElementsByTagName("x2")[0].firstChild.textContent);
		circleA[i].y2 = parseInt(temp.item(i).getElementsByTagName("y2")[0].firstChild.textContent);
		circleA[i].radius = parseInt(temp.item(i).getElementsByTagName("radius")[0].firstChild.textContent);
		circleA[i].radius2 = parseInt(temp.item(i).getElementsByTagName("radius2")[0].firstChild.textContent);
		circleA[i].begin = parseInt(temp.item(i).getElementsByTagName("begin")[0].firstChild.textContent);
		circleA[i].end = parseInt(temp.item(i).getElementsByTagName("end")[0].firstChild.textContent);
	}
	temp = xmlDoc.getElementsByTagName("circleAE");
	for (var i = 0; i < temp.length; i++) {
		circleAE[i] = {x:0,y:0,x2:0,y2:0,radius:0,radius2:0,begin:0,end:0};
		circleAE[i].x = parseInt(temp.item(i).getElementsByTagName("x")[0].firstChild.textContent);
		circleAE[i].y = parseInt(temp.item(i).getElementsByTagName("y")[0].firstChild.textContent);
		circleAE[i].x2 = parseInt(temp.item(i).getElementsByTagName("x2")[0].firstChild.textContent);
		circleAE[i].y2 = parseInt(temp.item(i).getElementsByTagName("y2")[0].firstChild.textContent);
		circleAE[i].radius = parseInt(temp.item(i).getElementsByTagName("radius")[0].firstChild.textContent);
		circleAE[i].radius2 = parseInt(temp.item(i).getElementsByTagName("radius2")[0].firstChild.textContent);
		circleAE[i].begin = parseInt(temp.item(i).getElementsByTagName("begin")[0].firstChild.textContent);
		circleAE[i].end = parseInt(temp.item(i).getElementsByTagName("end")[0].firstChild.textContent);
	}

	/* line */
	temp = xmlDoc.getElementsByTagName("line");
	for (var i = 0; i < temp.length; i++) {
		box[i] = {x:0,y:0,x2:0,y2:0};
		box[i].x = parseInt(temp.item(i).getElementsByTagName("x")[0].firstChild.textContent);
		box[i].y = parseInt(temp.item(i).getElementsByTagName("y")[0].firstChild.textContent);
		box[i].x2 = parseInt(temp.item(i).getElementsByTagName("x2")[0].firstChild.textContent);
		box[i].y2 = parseInt(temp.item(i).getElementsByTagName("y1")[0].firstChild.textContent);
	}
	temp = xmlDoc.getElementsByTagName("lineE");
	for (var i = 0; i < temp.length; i++) {
		lineE[i] = {x:0,y:0,x2:0,y2:0,begin:0,end:0};
		lineE[i].x = parseInt(temp.item(i).getElementsByTagName("x")[0].firstChild.textContent);
		lineE[i].y = parseInt(temp.item(i).getElementsByTagName("y")[0].firstChild.textContent);
		lineE[i].x2 = parseInt(temp.item(i).getElementsByTagName("x2")[0].firstChild.textContent);
		lineE[i].y2 = parseInt(temp.item(i).getElementsByTagName("y2")[0].firstChild.textContent);
		lineE[i].begin = parseInt(temp.item(i).getElementsByTagName("begin")[0].firstChild.textContent);
		lineE[i].end = parseInt(temp.item(i).getElementsByTagName("end")[0].firstChild.textContent);
	}
	temp = xmlDoc.getElementsByTagName("lineA");
	for (var i = 0; i < temp.length; i++) {
		lineA[i] = {x:0,y:0,x2:0,y2:0,x3:0,y3:0,x4:0,y4:0,begin:0,end:0};
		lineA[i].x = parseInt(temp.item(i).getElementsByTagName("x")[0].firstChild.textContent);
		lineA[i].y = parseInt(temp.item(i).getElementsByTagName("y")[0].firstChild.textContent);
		lineA[i].x2 = parseInt(temp.item(i).getElementsByTagName("x2")[0].firstChild.textContent);
		lineA[i].y2 = parseInt(temp.item(i).getElementsByTagName("y2")[0].firstChild.textContent);
		lineA[i].x3 = parseInt(temp.item(i).getElementsByTagName("x3")[0].firstChild.textContent);
		lineA[i].y3 = parseInt(temp.item(i).getElementsByTagName("y3")[0].firstChild.textContent);
		lineA[i].x4 = parseInt(temp.item(i).getElementsByTagName("x4")[0].firstChild.textContent);
		lineA[i].y4 = parseInt(temp.item(i).getElementsByTagName("y4")[0].firstChild.textContent);
		lineA[i].begin = parseInt(temp.item(i).getElementsByTagName("begin")[0].firstChild.textContent);
		lineA[i].end = parseInt(temp.item(i).getElementsByTagName("end")[0].firstChild.textContent);
	}
	temp = xmlDoc.getElementsByTagName("lineAE");
	for (var i = 0; i < temp.length; i++) {
		lineAE[i] = {x:0,y:0,x2:0,y2:0,x3:0,y3:0,x4:0,y4:0,begin:0,end:0};
		lineAE[i].x = parseInt(temp.item(i).getElementsByTagName("x")[0].firstChild.textContent);
		lineAE[i].y = parseInt(temp.item(i).getElementsByTagName("y")[0].firstChild.textContent);
		lineAE[i].x2 = parseInt(temp.item(i).getElementsByTagName("x2")[0].firstChild.textContent);
		lineAE[i].y2 = parseInt(temp.item(i).getElementsByTagName("y2")[0].firstChild.textContent);
		lineAE[i].x3 = parseInt(temp.item(i).getElementsByTagName("x3")[0].firstChild.textContent);
		lineAE[i].y3 = parseInt(temp.item(i).getElementsByTagName("y3")[0].firstChild.textContent);
		lineAE[i].x4 = parseInt(temp.item(i).getElementsByTagName("x4")[0].firstChild.textContent);
		lineAE[i].y4 = parseInt(temp.item(i).getElementsByTagName("y4")[0].firstChild.textContent);
		lineAE[i].begin = parseInt(temp.item(i).getElementsByTagName("begin")[0].firstChild.textContent);
		lineAE[i].end = parseInt(temp.item(i).getElementsByTagName("end")[0].firstChild.textContent);
	}
	
	/* TODO add video, img */

	/* path */
	temp = xmlDoc.getElementsByTagName("pathpoint");
	for (var i = 0; i < temp.length; i++) {
		path[i] = {x:0,y:0,zoom:0,angle:0};
		path[i].x = parseInt(temp.item(i).getElementsByTagName("x")[0].firstChild.textContent);
		path[i].y = parseInt(temp.item(i).getElementsByTagName("y")[0].firstChild.textContent);
		path[i].zoom = parseInt(temp.item(i).getElementsByTagName("zoom")[0].firstChild.textContent);
		path[i].angle = parseInt(temp.item(i).getElementsByTagName("angle")[0].firstChild.textContent);
		Presentation.appendPath(path[i].x, path[i].y, path[i].zoom, path[i].angle);
	}
	temp = xmlDoc.getElementsByTagName("pathpointE");
	for (var i = 0; i < temp.length; i++) {
		pathE[i] = {x:0,y:0,zoom:0,angle:0,time:0};
		pathE[i].x = parseInt(temp.item(i).getElementsByTagName("x")[0].firstChild.textContent);
		pathE[i].y = parseInt(temp.item(i).getElementsByTagName("y")[0].firstChild.textContent);
		pathE[i].zoom = parseInt(temp.item(i).getElementsByTagName("zoom")[0].firstChild.textContent);
		pathE[i].angle = parseInt(temp.item(i).getElementsByTagName("angle")[0].firstChild.textContent);
		pathE[i].time = parseInt(temp.item(i).getElementsByTagName("time")[0].firstChild.textContent);
		Presentation.appendPathE(path[i].x, path[i].y, path[i].zoom, path[i].angle, path[i].time);
	}

	/* fallback */
	if (path.length < 1 && pathE.length < 1) {
		/* to be able to see the presentation, even though there is no path existing */
		Presentation.appendPath(0,0, 1, 0);
	}
}
